package supermarket.dao.impl;

import java.util.List;

import supermarket.dao.CustomerCatalog;
import supermarket.dao.CustomerDao;
import supermarket.model.Customer;

public class CustomerCatalogImpl implements CustomerCatalog {

	private CustomerDao customerDao;
	
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}
	
	@Override
	public Customer getCustomer(Integer id) {
		return this.customerDao.findCustomer(id);
	}
	
	@Override
	public List getCustomerByName(String name) {
		return (List)this.customerDao.findCustomerByName(name);
	}
	
	@Override
	public List getCustomerList() {
		return this.customerDao.findAll();
	}
	
	@Override
	public void addCustomer(Customer customer) {
		this.customerDao.addCustomer(customer);
	}
	
	@Override
	public void addCustomerByName(String name) {
		this.customerDao.addCustomerByName(name);
	}
	
	@Override
	public void updateCustomer(Customer customer) {
		this.customerDao.updateCustomer(customer);
	}
	
	@Override
	public void removeCustomer(Customer customer) {
		this.customerDao.removeCustomer(customer);
	}

}
